@use '@angular/material' as mat;

@mixin search-color($theme) {
  $config: mat.m2-get-color-config($theme);
  $foreground: map-get($config, foreground);
  $background: map-get($config, background);
  $primary: map-get($config, primary);
  $accent: map-get($config, accent);
  $warn: map-get($config, warn);

  $light: map-get($background, card);

  .search-sidebar {
    background-color: mat.m2-get-color-from-palette($background, card);
    @include mat.elevation(
      5,
      mat.m2-get-color-from-palette($foreground, text),
      0.35
    );
    .mat-expansion-panel:not([class*='mat-elevation-z']) {
      border-bottom: 1px solid
        mat.m2-get-color-from-palette($foreground, divider);
    }
  }
  .search-list {
    .results {
      color: mat.m2-get-color-from-palette($foreground, text, 0.4);
    }
    .list {
      background-color: mat.m2-get-color-from-palette($background, card);
      border-bottom: 1px solid
        mat.m2-get-color-from-palette($foreground, divider, 0.1);
      color: mat.m2-get-color-from-palette($foreground, text, 0.45);
      .title,
      .content {
        em,
        strong {
          color: mat.m2-get-color-from-palette($warn);
          font-weight: normal;
          font-style: normal;
        }
        a {
          color: mat.m2-get-color-from-palette($foreground, text, 0.75);
          &:hover {
            color: mat.m2-get-color-from-palette($primary);
          }
          em,
          strong {
            color: mat.m2-get-color-from-palette($warn);
            font-weight: normal;
            font-style: normal;
          }
        }
      }
    }
  }

  .search-filter-dialog {
    .item {
      background-color: mat.m2-get-color-from-palette($foreground, text, 0.07);
      transition: all 0.1s ease-in;
      &.active,
      &:hover {
        background-color: mat.m2-get-color-from-palette($primary);
        color: mat.m2-get-color-from-palette($primary, default-contrast);
      }
    }
  }
}
